package com.wipz.eoa.iphone.settlemanagement.rentRemind;

import java.io.UnsupportedEncodingException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.wipz.eoa.iphone.BaseAction;
import com.wipz.eoa.iphone.IBaseService;

public class RentRemindAction extends BaseAction {

	
	private static final long serialVersionUID = 1L;
	private IBaseService baseService;
	private IRentRemindService rentRemindService;
	private List list;//租赁提醒列表
	private Object detail;//租赁提醒详情
	private List settingList;//租赁提醒列表
	private Object settingDetail;//租赁提醒详情
	public IBaseService getBaseService() {
		return baseService;
	}
	public void setBaseService(IBaseService baseService) {
		this.baseService = baseService;
	}
	public IRentRemindService getRentRemindService() {
		return rentRemindService;
	}
	public void setRentRemindService(IRentRemindService rentRemindService) {
		this.rentRemindService = rentRemindService;
	}
	public List getList() {
		return list;
	}
	public void setList(List list) {
		this.list = list;
	}
	public Object getDetail() {
		return detail;
	}
	public void setDetail(Object detail) {
		this.detail = detail;
	}
	
	public List getSettingList() {
		return settingList;
	}
	public void setSettingList(List settingList) {
		this.settingList = settingList;
	}
	public Object getSettingDetail() {
		return settingDetail;
	}
	public void setSettingDetail(Object settingDetail) {
		this.settingDetail = settingDetail;
	}
	/**
	 * 租赁提醒列表
	 * @return
	 */
	public String list(){
		String enterprisername=this.getRequest().getParameter("enterprisename");
		try {
			if(!"".equals(enterprisername) && enterprisername!=null){
				String s = new String(enterprisername.getBytes("iso-8859-1"),"utf-8");
				enterprisername= java.net.URLDecoder.decode(s, "utf-8");
			}
		} catch (UnsupportedEncodingException e) {
			return SUCCESS;
		}
		Map<String,String>	parms = new HashMap<String,String>();
		parms.put("enterprisername", enterprisername);
		list=baseService.queryList("rent.queryRemind", parms);
		return SUCCESS;
	}
	/**
	 * 租赁提醒详情
	 * @return
	 */
	public String detail(){
		String id=this.getRequest().getParameter("id");
		Map<String,String>	parms = new HashMap<String,String>();
		parms.put("id", id);
		detail=baseService.queryOne("rent.queryRentByID", parms);
		return SUCCESS;
	}
	
	/**
	 *  租赁提醒设置列表
	 * author：张涛
	 * date：2012-3-9
	 * time：下午04:12:15
	 * return：String
	 */
	public String settingList(){
		Map<String,String>	param = new HashMap<String,String>();
		//查询条件
		param.put("ENTERPRISENAME", this.getRequest().getParameter("ENTERPRISENAME"));
		param.put("REMINDDAYS", this.getRequest().getParameter("REMINDDAYS"));
		param.put("USERID", this.getRequest().getParameter("USERID"));
		//排序
		param.put("order", this.getRequest().getParameter("order"));
		param.put("sort", this.getRequest().getParameter("sort"));
		settingList=baseService.queryList("rent.query", param);
		return SUCCESS;
	}
	
	/**
	 * 租赁提醒设置详情
	 * author：张涛
	 * date：2012-3-9
	 * time：下午04:13:53
	 * return：String
	 */
	public String settingDetail(){
		String id=this.getRequest().getParameter("id");
		Map<String,String>	parms = new HashMap<String,String>();
		parms.put("ID", id);
		settingDetail=baseService.queryOne("rent.query", parms);
		return SUCCESS;
	}

}
